/*
 * Copyright 2025 arisgo@163.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.arisgo.cloud.auth.sys.entity;

import com.arisgo.cloud.web.model.ITenant;
import com.arisgo.cloud.web.model.NumberIdWithTime;
import com.mybatisflex.annotation.Table;

import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * 字典表
 * 此表为树形结构
 * parentId = 0 表示最高 level
 * parentId != 0 表示子 level
 * type 数据类型，父类型和子类型相同
 * name 展示名称
 * value 实际值，直接保存到数据库中的值
 * sort 排序
 *
 * @author Arisgo
 * @since 2024-06-14
 */
@Data
@Table("auth_dict")
@EqualsAndHashCode(callSuper = true)
public class Dict extends NumberIdWithTime implements ITenant {

    /**
     * 父级ID
     * parentId = 0 表示最高 level
     * parentId != 0 表示子 level
     */
    private Long parentId;
    /**
     * 租户id
     */
    private Long tenantId;
    /**
     * 数据类型，父类型和子类型相同
     */
    private String type;
    /**
     * 展示名称
     */
    private String name;
    /**
     * 实际值，直接保存到数据库中的值
     */
    private String value;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 备注
     */
    private String remark;

    public static final String PARENT_ID = "parent_id";
    public static final String TYPE = "type";
    public static final String NAME = "name";
    public static final String VALUE = "value";
    public static final String SORT = "sort";
    public static final String REMARK = "remark";
}
